<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>订单确认</title>
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/ordeconfirm.css">
</head>

<body class="body">
    <header class="header">
        <a href="javascript:;" class="left-arrow"></a>
        <div class="header_font">
            <p>订单确认</p>
        </div>
        <a href="" class="more"></a>
    </header>
    <div>
        <div class="message">
            <div class="message_header">
                <div class="message_header_place"></div>
                <a href="javascript:;" class="message_header_text">
                    <div>
                        <p>郭女士&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;178****8520</p>
                    </div>
                    <div>
                        <p>浙江省温州市鹿城城工业区泰力路37号B栋203室</p>
                    </div>
                </a>
                <div class="right"></div>
            </div>
            <div class="border"></div>
            <div class="commodity-details">
                <div class="commodity-details-body">
                    <div class="commodity-pic"></div>
                    <div class="commodity-text">
                        <p>依泉润唇膏套装 保湿滋润补水无色防干裂 唇部护理唇膜淡化唇纹护唇膏...</p>
                        <i>8g/ml</i>
                    </div>
                    <div class="commodity-price">
                        <p>¥98.9</p>
                        <p class="num">x1</p>
                        <a href="./return.html" class="button">申请退款</a>
                    </div>
                </div>
            </div>
            <div class="concrete-content">
                <div class="concrete-content-l">
                    <ul>
                        <li>配送方式</li>
                        <li>运费</li>
                        <li>优惠券</li>
                        <li>发货时间</li>
                        <li>订单备注</li>
                    </ul>
                </div>
                <div class="concrete-content-r">
                    <ul>
                        <li>普通快递 </li>
                        <li>¥0</li>
                        <li>无可用</li>
                        <li>7个工作日内安排发货</li>
                        <li>选填，请先和卖家协商一致</li>
                    </ul>
                </div>
                <div class="concrete-content-c">
                    <ul>
                        <li class="right_r"></li>
                        <li>&nbsp;</li>
                        <li class="right_r"></li>
                        <li>&nbsp;</li>
                        <li>&nbsp;</li>
                    </ul>
                </div>

            </div>
            <div class="price">
                <div class="pricea">共1件</div>
                <div class="priceb">小计</div>
                <div class="pricec">¥98.9</div>
            </div>

        </div>
        <div class="pay-for">
            <div class="pay-for-title">支付方式</div>
            <div class="pay-for-f ab">
                <div class="pay-for-zfb">
                    <div class="zfb"></div>
                    <div class="zfb-text">支付宝</div>
                    <div class="tujian-pay"></div>
                </div>
                <div class="pay-checked"></div>
                <div class="pay-for-wx-check none"></div>
            </div>

            <div class="pay-for-w ab">
                <div class="pay-for-wx">
                    <div class="pay-for-wx-pic"></div>

                    <div>微信支付</div>

                </div>
                <div class="pay-for-wx-check"></div>
                <div class="pay-checked none"></div>
            </div>

            <div class="pay-for-t">
                <div class="pay-checked"></div>
                <div class="pay-for-wx-check none"></div>
                <div>匿名购买</div>
            </div>
        </div>

        <div class="footer">
            <div class="box">
                <div class="frist">共一件</div>
                <div class="second">合计</div>
                <div class="third">¥98.9</div>
                <a href="./paysuccess.html" id="affirm">确认付款</a>
            </div>
        </div>
    </div>
    <script src="./js/rem.js "></script>
    <script>

        function getData(){
            let data = location.search
            data = data.slice(1,data.length)
            let reg = /=/ig
            data = data.replace(reg,'&')
            data = data.split('&')
            const first = document.getElementsByClassName('frist')[0];
            const price = document.getElementsByClassName('third')[0];
            const num = document.getElementsByClassName('num')[0];
            const pricec = document.getElementsByClassName('pricec')[0];

            // console.log(first);
            first.innerHTML = '共'+data[3]+'件'
            num.innerHTML = '×'+data[3]
            price.innerHTML = '￥'+data[1]
            pricec.innerHTML = '￥'+data[1]

        }
        getData()

        goNext('.message_header','./adress.html')
        goBack('.left-arrow')
        function Pick() {
            var AB = document.getElementsByClassName('ab')
            var Pick = document.getElementsByClassName('pay-for-wx-check')
            var Picked = document.getElementsByClassName('pay-checked ')
            console.log(Pick);
            console.log(Picked);


            for (let i = 0; i < AB.length; i++) {
                let f = true
                AB[i].onclick = function () {
                    for (let j = 0; j < AB.length; j++) {
                        Pick[j].style.display = 'block'
                        Picked[j].style.display = 'none'
                    }

                    Pick[i].style.display = 'none'
                    Picked[i].style.display = 'block'

                }

            }
        }
        Pick()
        function check() {
            var pay = document.querySelector('.pay-for-t')
            var Picked = pay.getElementsByClassName('pay-checked')[0]
            var Pick = pay.getElementsByClassName('pay-for-wx-check')[0]
            
            let f = true
            pay.onclick = function () {
                if (f) {
                    f = false
                    Picked.style.display = 'none'
                    Pick.style.display = 'block'
                } else {
                    f = true
                    Picked.style.display = 'block'
                    Pick.style.display = 'none'
                }

            }

        }
        check()
    </script>
</body>

</html>